package org.yray.io.gcdemo;

import com.alibaba.fastjson.JSON;

import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.util.Arrays;
import java.util.List;

public class ThreadDump {
    public static void main(String[] args) {
       List<ThreadInfo> list= Arrays.asList(ManagementFactory.getThreadMXBean().dumpAllThreads(true, true));
       for(ThreadInfo s:list)
       {
           System.out.println(JSON.toJSONString(s));
       }
    }
}
